Assignment 1 : Rendering Basics with PyTorch3D
...

Course - 16825 : Learning for 3D Vision
Name - Parth Nilesh Shah
AndrewId - pnshah

Date - 2/6/2024


1. Practicing with Cameras
...

1.1 360-degree Renders
...

cow_360_render.gif

1.2 Recreating the Dolly Zoom
...

dolly.gif

2. Practicing with Meshes
...

2.1 Constructing a Tetrahedron
...

tetrahedron_360.gif

Tetrahedron Mesh
Vertices - 4
Faces - 4

2. 2 Constructing a Cube
...

cube_360.gif

Cube Mesh
Vertices - 8
Faces - 12

3. Retexturing a Mesh
...

textured_cow_360.gif

Color 1 = (0.7, 0.7, 1)
Color 2 = (0.7, 1, 0.7)

P.S - just some numbers co-pilot generated, looked beautiful so I let it be.

4. Camera Transformations
...

Default
...

transform_cow_0.png

Transform 1
...

Since, the cow in the image is rotated by 90 degrees. R_relative rotates the camera by 90 deg in the z-axis.
We also see that, the cow is centered in the image. Therefore, we keep T_relative as all 0 since there is no translation involved.

R_rel = pytorch3d.transforms.euler_angles_to_matrix(
			torch.tensor([0, 0, 0]), "XYZ"
			).numpy()

T_rel = [0, 0, 0]

transform_cow_1.png

Transform 2
...

The cow appears smaller, so the camera must be translated away from the cow. Therefore we some non-zero value in z-axis of T_relative i.e [0, 0, d]
Since the orientation of the cow is the same as that in the default image. The R_relative matrix will be all 0s.

R_rel = pytorch3d.transforms.euler_angles_to_matrix(
			torch.tensor([0, 0, 0]), "XYZ"
			).numpy()
T_rel = [0, 0, 2]

transform_cow_2.png

Transform 3
...

The cow can be seen shifted a little in the down-left direction. Hence, we translate the camera by some positive value in the x-axis and negative value in the y-axis. So, T_relative becomes [d, -d, 0]
Since the orientation of the cow is the same as that in the default image. The R_relative matrix will be all 0s.

R_rel = pytorch3d.transforms.euler_angles_to_matrix(
			torch.tensor([0, 0, 0]), "XYZ"
			).numpy()
T_rel = [0.5, -0.5, 0]

transform_cow_3.png

Transform 4
...

Here, we see the cow from it's right and not the front, which means we are both translating and rotating the camera.
We first need to rotate the camera by 90 deg counter-clockwise around the y-axis.
After this the cow will be to the right of the camera, so we move the camera in negative x-axis by 3 to bring it to center and in negative z-direction to bring the cow (side-view) in center of frame again.

```python
R_rel = pytorch3d.transforms.euler_angles_to_matrix(
			torch.tensor([0, -np.pi/2, 0]), "XYZ"
			).numpy()
T_rel = [3, 0, 3]

transform_cow_4.png

5. Rendering Generic 3D Representations
...

5.1 Rendering Point Clouds from RGB-D Images
...

Point cloud corresponding to 1st Image -

plant1_360.gif

Point cloud corresponding to 2nd Image -

plant2_360.gif

Point cloud formed by union -

plant3_360.gif

5.2 Parametric Functions
...

Torus
torus_360.gif

"Figure 8" immersion of the Klein Bottle
mobius_360.gif

5.3 Implicit Surfaces
...

Torus
torus_mesh_360.gif

Segment of a spring
spring_mesh_360.gif

Tradeoffs between rendering a Mesh vs PointCloud

6. Do Something Fun
...

7. Sampling Points on a Mesh
...

10 samples
...

sampled_cow_10.gifcow_360_render.gif

100 Samples
...

sampled_cow_100.gifcow_360_render.gif

1000 Samples
...

sampled_cow_1000.gifcow_360_render.gif

10000 Samples
...

sampled_cow_10000.gifcow_360_render.gif